package com.timmy.test1;

import android.app.Application;
import android.util.DisplayMetrics;
import android.view.WindowManager;

import com.blankj.utilcode.util.ScreenUtils;

/**
 * Created by timmy on 2020/5/6.
 */
public class App extends Application {

    public static int SCREEN_HEIGHT = 0;
    public static int SCREEN_WIDTH  = 0;

    @Override
    public void onCreate() {
        super.onCreate();
        initApp();

    }

    private void initApp() {
        DisplayMetrics displayMetrics = new DisplayMetrics();
        WindowManager windowManager = (WindowManager) getApplicationContext().getSystemService("window");
        windowManager.getDefaultDisplay().getMetrics(displayMetrics);
        SCREEN_WIDTH = displayMetrics.widthPixels;
        SCREEN_HEIGHT = displayMetrics.heightPixels;
    }
}
